package com.snow.campuslink.user.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.snow.campuslink.user.entity.UserFocus;
import com.snow.campuslink.user.mapper.UserFocusMapper;
import com.snow.campuslink.user.service.IUserFocusService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import static cn.hutool.core.bean.BeanUtil.beanToMap;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Gaosl
 * @since 2021-03-02
 */
@Service
public class UserFocusServiceImpl extends ServiceImpl<UserFocusMapper, UserFocus> implements IUserFocusService {

    @Override
    public List<UserFocus> getFocus(UserFocus userFocus) {
        Map<String, Object> map = beanToMap(userFocus, true, true);
        QueryWrapper<UserFocus> userFocusQueryWrapper = new QueryWrapper<>();
        userFocusQueryWrapper.allEq(map);
        return  list(userFocusQueryWrapper);
    }

}
